/**
 * 版权所有(C) 晓祥工作室 2010-2020<br>
 * Copyright 2010-2020 XiaoXiang Workroom.<br>
 * 创建日期 2011-9-28
 */
package xx.services.util;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

public class Online
{
    private Online()
    {
    }

    private final static Map<String, HttpSession> sessions = new HashMap<String, HttpSession>();

    public static void created(HttpSession session)
    {
        sessions.put(session.getId(), session);
    }

    public static HttpSession getSession(String sessionId)
    {
        return sessions.get(sessionId);
    }

    public static void destroyed(String sessionId)
    {
        sessions.remove(sessionId);
    }
}
